<html><head><title>SplitterGadget</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">SplitterGadget()</font></b></p>
<p><b>Syntax</b></p><blockquote>
Result = <font color="#006666"><b>SplitterGadget</b></font>(#Gadget, x, y, Width, Height, #Gadget1, #Gadget2 [, Flags])</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Creates a Splitter gadget in the current GadgetList. This gadget allows two child gadgets to be 
resized by the user with a separator bar. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#Gadget</i></td>
<td width="90%"> 
A number to identify the new gadget. <a href="../reference/purebasic_objects.html">#PB_Any</a> can 
be used to auto-generate this number. 

</td></tr>
<tr><td><i>x, y, Width, Height</i></td>
<td> 
The position and dimensions of the new gadget. 

</td></tr>
<tr><td><i>#Gadget1, #Gadget2</i></td>
<td> 
The gadgets to be placed in the splitter. 

</td></tr>
<tr><td><i>Flags (optional)</i></td>
<td> 
Flags to modify the gadget behavior. It can be a combination of the following values: 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Splitter_Vertical</font>    : The gadget is split vertically (instead of horizontally which is the default).
  <font color="#924B72">#PB_Splitter_Separator</font>   : A 3D-looking separator is drawn in the splitter.
  <font color="#924B72">#PB_Splitter_FirstFixed</font>  : When the splitter gadget is resized, the first gadget will keep its size
  <font color="#924B72">#PB_Splitter_SecondFixed</font> : When the splitter gadget is resized, the second gadget will keep its size
</font></pre>

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>

Returns nonzero on success and zero on failure. If <font color="#924B72">#PB_Any</font> was used as the #Gadget parameter 
then the return-value is the auto-generated gadget number on success. 

</blockquote><p><b>Remarks</b></p><blockquote>

A 'mini help' can be added to this gadget using <a href="gadgettooltip.html">GadgetToolTip()</a>. 
<br>
<br>
The following functions can be used to act on a SplitterGadget: 
<br>
<br>
<a href="getgadgetstate.html">GetGadgetState()</a>: Get the current splitter position, in pixels. 
<br>
<a href="setgadgetstate.html">SetGadgetState()</a>: Change the current splitter position, in pixels. 
<br>
<a href="getgadgetattribute.html">GetGadgetAttribute()</a>: With one of the following attribute: 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Splitter_FirstMinimumSize</font> : Gets the minimum size (in pixels) than the first gadget can have.
  <font color="#924B72">#PB_Splitter_SecondMinimumSize</font>: Gets the minimum size (in pixels) than the second gadget can have.
  <font color="#924B72">#PB_Splitter_FirstGadget</font>      : Gets the gadget number of the first gadget.
  <font color="#924B72">#PB_Splitter_SecondGadget</font>     : Gets the gadget number of the second gadget.
</font></pre>

<a href="setgadgetattribute.html">SetGadgetAttribute()</a>: With one of the following attribute: 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_Splitter_FirstMinimumSize</font> : Sets the minimum size (in pixels) than the first gadget can have.
  <font color="#924B72">#PB_Splitter_SecondMinimumSize</font>: Sets the minimum size (in pixels) than the second gadget can have.
  <font color="#924B72">#PB_Splitter_FirstGadget</font>      : Replaces the first gadget with a new one.
  <font color="#924B72">#PB_Splitter_SecondGadget</font>     : Replaces the second gadget with a new one.
</font></pre>

<b>Note:</b> When replacing a gadget with <a href="setgadgetattribute.html">SetGadgetAttribute()</a>, the old gadget will not 
be automatically freed. It will instead be put back on the parent window of the Splitter. This allows to switch gadgets 
between splitters without the need to recreate any of them. If the old gadget should be freed, its number can first be retrieved with 
<a href="getgadgetattribute.html">GetGadgetAttribute()</a>, and the gadget freed with <a href="freegadget.html">FreeGadget()</a> after 
it has been replaced. Note that a gadget cannot be in two splitters at once. So to move a gadget from one splitter to 
another, it first needs to be replaced in the first splitter so it is on the main window and then it can be put into 
the second splitter. 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">If</font></b> <font color="#006666">OpenWindow</font>(0, 0, 0, 230, 180, "SplitterGadget", <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
    <font color="#924B72">#Button1</font>  = 0
    <font color="#924B72">#Button2</font>  = 1
    <font color="#924B72">#Splitter</font> = 2

<font color="#006666">    ButtonGadget</font>(<font color="#924B72">#Button1</font>, 0, 0, 0, 0, "Button 1") <font color="#006666">; No need to specify size or coordinates</font>
<font color="#006666">    ButtonGadget</font>(<font color="#924B72">#Button2</font>, 0, 0, 0, 0, "Button 2") <font color="#006666">; as they will be sized automatically</font>
<font color="#006666">    SplitterGadget</font>(<font color="#924B72">#Splitter</font>, 5, 5, 220, 120, <font color="#924B72">#Button1</font>, <font color="#924B72">#Button2</font>, <font color="#924B72">#PB_Splitter_Separator</font>)

<font color="#006666">    TextGadget</font>(3, 10, 135, 210, 40, "Above GUI part shows two automatically resizing buttons inside the 220x120 SplitterGadget area.",<font color="#924B72">#PB_Text_Center</font> )

    <b><font color="#006666">Repeat</font></b>
    <b><font color="#006666">Until</font></b> <font color="#006666">WaitWindowEvent</font>() = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#006666">EndIf</font></b>
</font></pre>
<br>
<p><img src="../HelpPictures/splittergadget.png"></p>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="getgadgetstate.html">GetGadgetState()</a>, <a href="setgadgetstate.html">SetGadgetState()</a>, <a href="getgadgetattribute.html">GetGadgetAttribute()</a>, <a href="setgadgetattribute.html">SetGadgetAttribute()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=spingadget.html>SpinGadget()</a> - <a href=index.html>Gadget Index</a> - <a href=stringgadget.html>StringGadget()</a> ->

</body></html>